import { Vue, Component } from "vue-property-decorator"
@Component
export default class ToTop extends Vue {
  public toTop () {
    // 兼容微信6.74 ios12版本
    const u:String = navigator.userAgent
    const isiOS:Boolean = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
    if (isiOS) {
      setTimeout(()=>{
        const scrollHeight:any = document.documentElement.scrollTop || document.body.scrollTop || 0
        window.scrollTo(0, Math.max(scrollHeight - 1, 0))
      }, 50)
    }
  }
}
